package me.zhengjie.modules.rest;

import cn.hutool.core.date.DateTime;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.domain.Batch;
import me.zhengjie.modules.service.BatchService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class BatchController {

    private final BatchService batchService;

    //@Scheduled(fixedRate = 1000*60)
    public void createBatch(){
        Batch batch=new Batch();
        batch.setBatchNo(util.SnowFlakeUtil.getSnowFlakeId());
        batch.setCreateTime(new DateTime(
        ));
        batchService.createBatch(batch);
    }

}
